const Mock = require('mockjs')

const data = Mock.mock({
  'result|12': [{
    id: '@id',
    name: '@cword(2,8)',
    summary: '@cword(8,16)',
    count: '@integer(300, 5000)',
    created_time: '@datetime',
    storage: 'badUrl4',
    source: 'http://baidu.com/',
    tags: [
      'ncbi',
      'csbq'
    ]
  }]
})

module.exports = [
  {
    url: '/api/search_dataset',
    type: 'get',
    response: config => {
      const items = data.result
      return {
        code: 200,
        data: {
          total_count: items.length,
          result: items
        }
      }
    }
  }
]
